#!/usr/bin/env bash
set -ex

if grep -q -w "$SLURM_JOB_USER" /etc/slurm/localusers.backup ; then
    exit 0  # don't revoke access for these users
fi

sed -i "/${SLURM_JOB_USER}/d" /etc/localusers
